{-# LANGUAGE EmptyDataDecls, TypeFamilies #-}

module Type.Yoko.Maybe where

import Type.Booleans



data Nothing; data Just a

type family IsJust a
type instance IsJust Nothing = False
type instance IsJust (Just x) = True

type family FromJust a
type instance FromJust (Just x) = x

type family MaybePlus a b
type instance MaybePlus Nothing b = b
type instance MaybePlus (Just a) b = Just a

type family FromMaybe a b
type instance FromMaybe a Nothing  = a
type instance FromMaybe a (Just b) = b
